<!--
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>

<img src="http://the.echonest.com/media/images/logos/250x80_lt.gif"/> <br>
This is a Java client for <a href="developer.echonest.com">the Echo Nest developer API.</a> With this API you gain access to a wide variety of artist information as well as access to detailed track level information. To use this API, you need to get an API key which is available for free at <a href="http://developer.echonest.com">developer.echonest.com</a>

<h2> Examples </h2>
<h3><a name="Track_BPM_example"/>Track BPM example</h3>
<pre>    
    TrackAPI trackAPI = new TrackAPI(MY_ECHO_NEST_API_KEY);
    String id = trackAPI.uploadTrack(new File(&quot;/path/to/music/track.mp3&quot;), false);
    AnalysisStatus status = trackAPI.waitForAnalysis(id, 60000);
    if (status == AnalysisStatus.COMPLETE) {
       System.out.println(&quot;Tempo in BPM: &quot; + trackAPI.getTempo(id));
    }                 
</pre><p>

<h3><a name="Artist_Audio_example"/>Artist Audio example</h3>
<p>Use the Echo Nest Artist API to find audio for an artist </p>
<pre> 
   ArtistAPI artistAPI = new ArtistAPI(MY_ECHO_NEST_API_KEY);

   List&lt;Artist&gt; artists = artistAPI.searchArtist(&quot;The Decemberists&quot;, false);
   if (artists.size() &gt; 0) {
     for (Artist artist : artists) {
         DocumentList&lt;Audio&gt; audioList = artistAPI.getAudio(artist, 0, 15);
         for (Audio audio : audioList.getDocuments()) {
            System.out.println(audio.toString());
         }
     }
   }
</pre><p> 

<h3><a name="Artist_Similarity_Example"/>Artist Similarity Example</h3>
<p>Here&#x27;s an example of code to print out all artists that are similar to &#x27;Weezer&#x27; </p>
<pre>   
  ArtistAPI artistAPI = new ArtistAPI(MY_ECHO_NEST_API_KEY);

   List&lt;Artist&gt; artists = artistAPI.searchArtist(&quot;weezer&quot;, false);
   if (artists.size() &gt; 0) {
     for (Artist artist : artists) {
          List&lt;Scored&lt;Artist&gt;&gt; similars = artistAPI.getSimilarArtists(artist, 0, 10);
          for (Scored&lt;Artist&gt; simArtist : similars) {
              System.out.println(&quot;   &quot; + simArtist.getItem().getName());
          }
      }
   }
</pre>
  </body>
</html>
